import { typeList } from "@/api/task"
export default {
    namespaced: true,
    state: {
        types: []
    },
    mutations: {
        updateTypes(state, val) {
            state.types = val
        }
    },
    actions: {
        getTypes(context) {
            return new Promise((resolve, reject) => {
                typeList().then(res => {  
                    // console.log(res,'类型列表');
                    context.commit("updateTypes", res.data)
                    resolve()
                }).catch(error => {
                    reject(error)
                })
            })

        },
    },
    getters: {}
}
